import module namespace json = "http://marklogic.com/json" at "lib/json.xqy";
json:serialize(
    json:array(
		for $c in //concept, $s in $c/source 
		where $s/@id="book_p1.xml" and $s/xpath="/catalog/book/author" 
		return    json:object((
			"column", $c/relational/name/text(),
			"table", $c/relational/table/text(),
			"domain", $c/relational/domain/text()
		))
	)
)
(:
<relational>     
	<column>{$c/relational/name/text()}</column>     
	<table>{$c/relational/table/text()}</table>     
	<domain>{$c/relational/domain/text()}</domain>   
</relational>:)